import request from '@/router/axios';

/**
 * @param current 当前页
 * @param size 每页数据量
 * @returns {AxiosPromise}
 */
export const getParentList = (current, size,params) => {
  return request({
    url: '/api/blade-produce/blade-basic/procedure/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getChildList = (current, size, params) => {
  return request({
    url: '/api/blade-produce/blade-basic/station/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-produce/blade-basic/procedure/submit',
    method: 'post',
    data: row
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-produce/blade-basic/procedure/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const getNodeList = (current, size,params) => {
  return request({
    url: '/api/blade-produce/blade-basic/node/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getLineList = (current, size,params) => {
  return request({
    url: '/api/blade-produce/blade-basic/line/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getFactoryNode = (id) => {
  return request({
    url: '/api/blade-produce/blade-basic/node/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
